# Maintainer: Antonio Rojas <arojas@archlinux.org>

_pipname=jupyter-sphinx
pkgname=python-$_pipname
pkgver=0.4.0
pkgrel=2
pkgdesc='Jupyter Sphinx Extensions'
arch=(any)
url='https://github.com/jupyter/jupyter-sphinx/'
license=(BSD)
depends=(python-sphinx python-ipywidgets jupyter-nbconvert)
makedepends=(python-build python-installer python-setuptools python-wheel)
checkdepends=(python-pytest)
#source=(https://pypi.io/packages/source/j/$_pipname/$_pipname-$pkgver.tar.gz) - doesn't include tests
source=(https://github.com/jupyter/jupyter-sphinx/archive/v$pkgver/$pkgname-$pkgver.tar.gz)
sha256sums=('85999a5f224281ee95263787313b5cbf48fb3c0f406a88ad5d9debcf1d4d06d4')

build() {
  cd $_pipname-$pkgver
  python -m build --wheel --no-isolation
}

check() {
  cd $_pipname-$pkgver
  PYTHONPATH="$PWD"/build/lib \
  pytest -v
}

package() {
  cd $_pipname-$pkgver
  python -m installer --destdir="$pkgdir" dist/*.whl

  install -Dm644 LICENSE -t "$pkgdir"/usr/share/licenses/$pkgname
}
